<?php
	include_once("../persistent/BaseObject.php");
	include_once("../manager/GroupManager.php");
	
	class GroupMa extends BaseObject
	{
		static $instance;
		private $group;
		
		public function __construct($d)
		{
			$this->tableName = "GroupManagers";
			parent::__construct($d);	
		}		
		
		// ================edit BY Tianjiao Li @2013-01-07 21:14pm
		public function addAMember($username)
		{
			$groupManger = new GroupManager();
			$data = array("username"=>$username,"Groupname"=>$_SESSION['currentGroup']);
			
			$groupManger->Memberof($data);
		}
		
		public function deleteAMember($username)
		{
			$con = $this->openDB();
			$anotherTable = "Memberof";
			
			$sql = "DELETE FROM $anotherTable
			WHERE Username = '$username'";
			
			$this->startSQL($sql,$con);
		}
	}

?>
